//
//  ZCSListenListListModel.m
//  聆听FM
//
//  Created by dllo on 16/6/13.
//  Copyright © 2016年 Dark. All rights reserved.
//

#import "ZCSListenListListModel.h"

@implementation ZCSListenListListModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
     [super setValue:value forUndefinedKey:key];
    if ([key isEqualToString:@"trackId"]) {
        self.id = [value integerValue];
    }
    
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    //序列化:(归档时使用)
    [aCoder encodeObject:self.albumCoverUrl290 forKey:@"albumCoverUrl290"];
    [aCoder encodeObject:self.intro forKey:@"intro"];
    [aCoder encodeObject:self.nickname forKey:@"nickname"];
    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeObject:self.playPath32 forKey:@"playPath32"];
    [aCoder encodeObject:self.playPath64 forKey:@"playPath64"];
    [aCoder encodeObject:self.coverSmall forKey:@"coverSmall"];
    [aCoder encodeInteger:self.tracksCounts forKey:@"tracksCounts"];
    [aCoder encodeInteger:self.lastUptrackAt forKey:@"lastUptrackAt"];
    [aCoder encodeInteger:self.isFinished forKey:@"isFinished"];
    [aCoder encodeInteger:self.serialState forKey:@"serialState"];
    [aCoder encodeInteger:self.commentsCounts forKey:@"commentsCounts"];
    [aCoder encodeInteger:self.favoritesCounts forKey:@"favoritesCounts"];
    [aCoder encodeInteger:self.createdAt forKey:@"createdAt"];
    [aCoder encodeInteger:self.duration forKey:@"duration"];
    [aCoder encodeInteger:self.playsCounts forKey:@"playsCounts"];
    [aCoder encodeInteger:self.uid forKey:@"uid"];
    [aCoder encodeInteger:self.sharesCounts forKey:@"sharesCounts"];
    [aCoder encodeInteger:self.id forKey:@"id"];
}
//反序列化:(反归档时使用)
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.albumCoverUrl290 = [aDecoder decodeObjectForKey:@"albumCoverUrl290"];
        self.intro = [aDecoder decodeObjectForKey:@"intro"];
        self.nickname = [aDecoder decodeObjectForKey:@"nickname"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.playPath64 = [aDecoder decodeObjectForKey:@"playPath64"];
        self.playPath32 = [aDecoder decodeObjectForKey:@"playPath32"];
        self.coverSmall = [aDecoder decodeObjectForKey:@"coverSmall"];
        self.tracksCounts = [aDecoder decodeIntegerForKey:@"tracksCounts"];
        self.lastUptrackAt = [aDecoder decodeIntegerForKey:@"lastUptrackAt"];
        self.isFinished = [aDecoder decodeIntegerForKey:@"isFinished"];
        self.serialState = [aDecoder decodeIntegerForKey:@"serialState"];
        self.commentsCounts = [aDecoder decodeIntegerForKey:@"commentsCounts"];
        self.favoritesCounts = [aDecoder decodeIntegerForKey:@"favoritesCounts"];
        self.createdAt = [aDecoder decodeIntegerForKey:@"createdAt"];
        self.duration = [aDecoder decodeIntegerForKey:@"duration"];
        self.playsCounts = [aDecoder decodeIntegerForKey:@"playsCounts"];
        self.uid = [aDecoder decodeIntegerForKey:@"uid"];
        self.sharesCounts = [aDecoder decodeIntegerForKey:@"sharesCounts"];
        self.id = [aDecoder decodeIntegerForKey:@"id"];
        
    }
    return self;
}



@end


